<!--!
This file is a part of MediaDrop (http://www.mediadrop.net),
Copyright 2009-2013 MediaCore Inc., Felix Schwarz and other contributors.
For the exact contribution history, see the git revision log.
The source code contained in this file is licensed under the GPLv3 or
(at your option) any later version.
See LICENSE.txt in the main project directory, for more information.
-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:py="http://genshi.edgewall.org/"
      xmlns:xi="http://www.w3.org/2001/XInclude">
<xi:include href="./master.html" />
<xi:include href="./media/_media-table.html" />
<head>
	<title>Dashboard</title>
	<link href="${h.url_for('/admin/styles/media.css')}" media="screen" rel="stylesheet" type="text/css" />
	<script type="text/javascript" src="${h.url_for('/admin/scripts/show-more.js')}"></script>
	<script type="text/javascript">
		window.addEvent('domready', function(){
			var reviewMore = new ShowMore({
				table: 'review-table',
				fetchUrl: '${h.url_for(controller='/admin/index', action='media_table', table='awaiting_review')}',
				pageNum: ${review_page.page},
				lastPage: ${review_page.last_page or 1}
			});
			var encodeMore = new ShowMore({
				table: 'encode-table',
				fetchUrl: '${h.url_for(controller='/admin/index', action='media_table', table='awaiting_encoding')}',
				pageNum: ${encode_page.page},
				lastPage: ${encode_page.last_page or 1}
			});
			var publishMore = new ShowMore({
				table: 'publish-table',
				fetchUrl: '${h.url_for(controller='/admin/index', action='media_table', table='awaiting_publishing')}',
				pageNum: ${publish_page.page},
				lastPage: ${publish_page.last_page or 1}
			});
		});
	</script>
</head>
<body class="menu-dashboard-on">
	<div class="column66">

		<div class="box">
			<h1 class="box-head">Awaiting Review</h1>
			<xi:include href="./media/dash-table.html" py:with="media=review_page.items; id='review-table';" />
		</div>

		<div class="box">
			<h1 class="box-head">Awaiting Encoding</h1>
			<xi:include href="./media/dash-table.html" py:with="media=encode_page.items; id='encode-table';" />
		</div>

		<div class="box">
			<h1 class="box-head">Awaiting Publishing</h1>
			<xi:include href="./media/dash-table.html" py:with="media=publish_page.items; id='publish-table';" />
		</div>

	</div>
	<div class="column33">
		<div class="box">
			<h1 class="box-head">Get Started</h1>
			<div class="box-content">
				<a href="${h.url_for(controller='admin/media', action='new')}" class="btn blue block"><span>Add New Media</span></a>
			</div>
		</div>

		<div class="box" py:replace="comment_stats_box(h.url_for(controller='/admin/comments'), query=comments)" />

		<div class="box">
			<h1 class="box-head">Recently Published</h1>
			<xi:include href="./media/_media-table.html" />
			${media_table(recent_media, fields=['type', 'title'], include_thead=False, include_pagination=False, id='recently-published-table')}
		</div>

	</div>
</body>
</html>
